//
//  TCLYAddressView.m
//  YuErmuYing
//
//  Created by LYang on 16/8/27.
//  Copyright © 2016年 Tiancheng. All rights reserved.
//

#import "TCLYAddressView.h"
#import "Masonry.h"
#import "Macros.h"

@implementation TCLYAddressView
-(instancetype)init{
    if (self = [super init]) {
        self.backgroundColor = bgColor;
        UIImageView * imageView = [[UIImageView alloc] init];
        imageView.image = [UIImage imageNamed:@"mineAddress"];
        [self addSubview:imageView];
        [imageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.mas_equalTo(self);
            make.centerX.mas_equalTo(self);
            make.width.mas_equalTo(80);
            make.height.mas_equalTo(80);
        }];
        
        UILabel * label = [[UILabel alloc] init];
        label.text = @"您还没有添加收货地址,该怎么收货呢?";
        label.textColor = grayFont;
        label.textAlignment = NSTextAlignmentCenter;
        label.font = [UIFont systemFontOfSize:14];
        [self addSubview:label];
        [label mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(imageView.mas_bottom).offset(20);
            make.left.mas_equalTo(self);
            make.right.mas_equalTo(self);
            make.height.mas_equalTo(20);
        }];
        
        self.addressBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        [self.addressBtn setTitle:@"随便逛逛" forState:UIControlStateNormal];
        [self.addressBtn setTitleColor:btnColor forState:UIControlStateNormal];
        self.addressBtn.titleLabel.font = [UIFont boldSystemFontOfSize:14];
        self.addressBtn.layer.cornerRadius = 2;
        self.addressBtn.layer.borderColor = btnColor.CGColor;
        self.addressBtn.layer.borderWidth = 1;
        [self addSubview:self.addressBtn];
        [self.addressBtn mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(label.mas_bottom).offset(20);
            make.centerX.mas_equalTo(self);
            make.height.mas_equalTo(30);
            make.width.mas_equalTo(60);
        }];        
        
    }
    return self;
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
